 

import request from '@/router/axios'

const prefix = '/rca/swckbackelectronicbill'
const bocPrefix = `${prefix}boctmp`
const ccbPrefix = `${prefix}ccbtmp`

export function fetchList(query) {
  return request({
    url: `${prefix}/page`,
    method: 'get',
    params: query
  })
}

export const tmp = {
  boc: {
    list: (query)=>{
      return request({
        url: `${bocPrefix}/list`,
        method: 'get',
        params: query
      })
    },
    // 下载模板
    template: (query)=>{
      return request({
        url: `${bocPrefix}/exportTamplate`,
        method: 'get',
        responseType: 'blob',
        params: query
      })
    },
    upload: (query)=>{
      return request({
        url: `${bocPrefix}/saveBatch`,
        method: 'post',
        headers: {
          'Content-Type': 'multipart/form-data'
        },
        data: query
      })
    },
    save: (query)=>{
      return request({
        url: `${bocPrefix}/saveBatchOk`,
        method: 'post',
        data: query
      })
    },
    cancel: (query)=>{
      return request({
        url: `${bocPrefix}/saveBatchCancel`,
        method: 'post',
        data: query
      })
    },
  },
  ccb : {
    list: (query)=>{
      return request({
        url: `${ccbPrefix}/list`,
        method: 'get',
        params: query
      })
    },
    // 下载模板
    template: (query)=>{
      return request({
        url: `${ccbPrefix}/exportTamplate`,
        method: 'get',
        responseType: 'blob',
        params: query
      })
    },
    upload: (query)=>{
      return request({
        url: `${ccbPrefix}/saveBatch`,
        method: 'post',
        headers: {
          'Content-Type': 'multipart/form-data'
        },
        data: query
      })
    },
    save: (query)=>{
      return request({
        url: `${ccbPrefix}/saveBatchOk`,
        method: 'post',
        data: query
      })
    },
    cancel: (query)=>{
      return request({
        url: `${ccbPrefix}/saveBatchCancel`,
        method: 'post',
        data: query
      })
    },
  }
}

